//
//  CollectionGameCell.swift
//  DouYu
//
//  Created by 王鹏宇 on 2018/4/13.
//  Copyright © 2018年 王鹏宇. All rights reserved.
//

import UIKit

class CollectionGameCell: UICollectionViewCell {

    @IBOutlet weak var iconImageView: UIImageView!
    
    @IBOutlet weak var titleLabel: UILabel!
    
    //MARK: 定义模型属性
    var baseGame : AnchorGroup? {
        didSet {
            
            titleLabel.text = baseGame?.tag_name
            if let iconURL = URL(string: baseGame?.icon_url ?? ""){
                iconImageView.kf.setImage(with: iconURL, placeholder:UIImage(named: "live_cell_default_phone"))
            }else{
                iconImageView.image = #imageLiteral(resourceName: "home_more_btn")
            }
        }
    }
    
    override func awakeFromNib() {
        super.awakeFromNib()
        
        iconImageView.layer.cornerRadius = 22.5
        iconImageView.clipsToBounds = true
        // Initialization code
    }

}
